
<h1>Inbox</h1>
<table>
	<tr>
		<th>status</th>
		<th>from userid</th>
		<th>message</th>
		<th>action</th>
	</tr>
	<?php $i=0; foreach($giveMessages as $giveMessage): $i++; ?>
	<tr>
		<td><?php if($giveMessage['UserMessage']['view_flag']){
					echo 'readed';
				  }else{
				  	echo 'new';
				  } ?></td>
		<td><?php echo $giveMessage['UserMessage']['from_user_id'] ?></td>
		<td><?php echo $giveMessage['UserMessage']['message']; ?></td>
		<td><?php 
				echo $this->Html->link('delete', array('action'=>'deleteMessage', $giveMessage['UserMessage']['id']));
				echo ' | ';
				echo $this->Html->link('view', array('action'=>'viewNewMessage', $giveMessage['UserMessage']['id']));
			?></td>
	</tr>
	<?php endforeach; ?>
</table>
<br>
<hr>
<h1>Sentbox</h1>
<table>
	<tr>
		<th>status</th>
		<th>to userid</th>
		<th>message</th>
		<th>action</th>
	</tr>
	<?php $i=0; foreach($sendMessages as $sendMessage): $i++; ?>
	<tr>
		<td><?php if($sendMessage['UserMessage']['view_flag']){
					echo 'readed';
				  }else{
				  	echo 'new';
				  } ?></td>
		<td><?php echo $sendMessage['UserMessage']['to_user_id'] ?></td>
		<td><?php echo $sendMessage['UserMessage']['message']; ?></td>
		<td><?php 
				echo $this->Html->link('delete', array('action'=>'deleteMessage', $sendMessage['UserMessage']['id']));

			?></td>
	</tr>
	<?php endforeach; ?>
</table>
<?php echo $this->Html->link('User index', array('controller'=>'Users','action'=>'index')); ?>